﻿<UserControl x:Class="Daphne.Controls.GameStateControl"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:loc="http://schemas.tomer.com/winfx/2006/xaml/presentation"            
             mc:Ignorable="d" 
            xmlns:ctrl = "clr-namespace:Daphne.Controls"             
             d:DesignHeight="300" d:DesignWidth="300">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="160" />
            <RowDefinition Height="20"/>            
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>
        <ctrl:PDNHeaderEditor x:Name="uxPDNEditor" />
        <CheckBox  Margin="90,0,0,0" Grid.Row="1" x:Name="uxNumberNotation" loc:Translate.Uid="CTR_NumberNotation" Content="{loc:Translate}" IsChecked="False" VerticalAlignment="Center" />
        <DataGrid  Grid.Row="2" x:Name="uxGameList" Height="auto" HeadersVisibility="None" HorizontalContentAlignment="Stretch" HorizontalAlignment="Stretch" BorderThickness="0" GridLinesVisibility="None" >
            <DataGrid.Columns>
                <DataGridTextColumn Width="30"  Binding="{Binding Path=Index}" IsReadOnly="True"  FontWeight="Bold">
                    <DataGridTextColumn.CellStyle>
                        <Style TargetType="DataGridCell">
                            <Setter Property="Background" Value="{DynamicResource WindowBackgroundBrush}" />
                            <Setter Property="BorderBrush" Value="{DynamicResource TextBrush}" />
                            <Setter Property="Foreground" Value="{DynamicResource TextBrush}" />
                            <Setter Property="BorderThickness" Value="0,1,0,0" />
                            <Style.Triggers>
                                <DataTrigger Binding="{Binding Path=Index}" Value="1">
                                    <Setter Property="BorderThickness" Value="0,0,0,0" />
                                </DataTrigger>                                
                            </Style.Triggers>
                            
                        </Style>
                    </DataGridTextColumn.CellStyle>

                </DataGridTextColumn>
                <DataGridTextColumn  IsReadOnly="True" Binding="{Binding Path=WhiteMove}" Width="*">
                    <DataGridTextColumn.CellStyle>
                        <Style TargetType="DataGridCell">
                            <Setter Property="Background" Value="{Binding Path=WhiteMoveColor}" />
                            <Setter Property="BorderBrush" Value="{DynamicResource TextBrush}" />
                            <Setter Property="Foreground" Value="{DynamicResource TextBrush}" />
                            <Setter Property="BorderThickness" Value="0,1,1,0" />                            
                            <Style.Triggers>
                                <DataTrigger Binding="{Binding Path=Index}" Value="1">
                                    <Setter Property="BorderThickness" Value="0,0,1,0" />
                                </DataTrigger>
                                <DataTrigger Binding="{Binding Path=CurrentMoveWhite}" Value="True">
                                    <Setter Property="FontWeight" Value="Bold" />
                                    <Setter Property="Foreground" Value="Red" />
                                </DataTrigger>
                            </Style.Triggers>
                        </Style>
                    </DataGridTextColumn.CellStyle>
                </DataGridTextColumn>
                <DataGridTextColumn  IsReadOnly="True" Binding="{Binding Path=BlackMove}" Width="*">
                    <DataGridTextColumn.CellStyle>
                        <Style TargetType="DataGridCell">
                            <Setter Property="Background" Value="{Binding Path=BlackMoveColor}" />
                            <Setter Property="BorderBrush" Value="{DynamicResource TextBrush}" />
                            <Setter Property="Foreground" Value="{DynamicResource TextBrush}" />
                            <Setter Property="BorderThickness" Value="0,1,0,0" />
                            <Style.Triggers>
                                <DataTrigger Binding="{Binding Path=Index}" Value="1">
                                    <Setter Property="BorderThickness" Value="0,0,0,0" />
                                </DataTrigger>
                                <DataTrigger Binding="{Binding Path=CurrentMoveBlack}" Value="True">
                                    <Setter Property="FontWeight" Value="Bold" />
                                    <Setter Property="Foreground" Value="Red" />
                                </DataTrigger>
                            </Style.Triggers>

                        </Style>
                    </DataGridTextColumn.CellStyle>
                </DataGridTextColumn>                                      
            </DataGrid.Columns>               
            <DataGrid.RowStyle>
                <Style TargetType="DataGridRow">
                    <Setter Property="BorderThickness" Value="0,0,0,0" />
                </Style>
            </DataGrid.RowStyle>
        </DataGrid>
    </Grid>
</UserControl>
